<template>
	<view class="_p20 _wrapper-y">
		<view class="_flex">
			<view style="width: 30%;">
				<el-input v-model="fileUrl"></el-input>
			</view>
			<el-button type="primary" @click="preview = true">预览</el-button>
		</view>
		<view v-if="fileUrl && preview" class="_page _wrapper-y _m-t-10">
			<iframe :src="`https://view.xdocin.com/view?src=${fileUrl}`" style="outline: none;border: none;width: 100%;height: 100%;"></iframe>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fileUrl: "",
				preview: false
			}
		},
		watch: {
			fileUrl() {
				this.preview = false;
			}
		}
	}
</script>

<style>

</style>
